package com.itheima.demo;

public class TestFlyable {
    public static void main(String[] args) {
        useFly(new Flyable() {
            @Override
            public void fly() {
                System.out.println("老子会飞!");
            }
        });
        Flyable f = getFly();
        f.fly();
    }
    public static void useFly(Flyable f){
        f.fly();
    }

    public static Flyable getFly(){
        return new Flyable() {
            @Override
            public void fly() {
                System.out.println("翅膀断了,飞不了了!");
            }
        };
    }

}
class A {
    public void fly(){
        new Flyable(){

            @Override
            public void fly() {

            }
        };
    }
}
